import axios from 'axios'

axios.defaults.baseURL = 'http://ludir.cn:8888/api/private/v1/'

// 请求拦截器
axios.interceptors.request.use((config: any) => {
  const { token } = JSON.parse(localStorage.getItem('user') as any || '{}')
  config.headers.Authorization = token
  return config
}, (error) => {
  console.log(error)
})

export default axios
